{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Last Simtax import: 2018-10-03 17:54:31.242409\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<module 'simtax' from '/Users/yanndecarie/Dropbox (CEDIA)/Simtax_py/simtax.py'>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import importlib\n",
    "importlib.reload(simtax)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "test = simtax.Household(year=2016, prov=5, age_1=30, inc_earning_1=50000, ind_couple=False)\n",
    "#test.inc_private_pension_1 = 50000\n",
    "test.year\n",
    "test.inctaxes()\n",
    "\n",
    "#print(test.prov_inctaxes_1)\n",
    "#print(test.fed_inctaxes_1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2016"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test.year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.0"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "test.inctaxes()\n",
    "test.oas_inc_1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "columns=['year', 'prov', 'age_1', 'inc_earning', 'ind_couple' ]\n",
    "df = pd.DataFrame(columns=columns)\n",
    "df.loc[0] = [2016, 5, 30, 90000, False]\n",
    "\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "test = simtax.Household(year=df.loc[0,'year'], prov=df.loc[0,'prov'], age_1=df.loc[0,'age_1'], inc_earning_1=\n",
    "                        df.loc[0,'inc_earning'], ind_couple=df.loc[0,'ind_couple'])\n",
    "test.year"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "columns_out=['prov_inctaxes_1', 'fed_inctaxes_1']\n",
    "df_out =pd.DataFrame(columns=columns_out)\n",
    "df_out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "columns=['year', 'prov', 'age_1', 'inc_earning', 'ind_couple' ]\n",
    "df = pd.DataFrame(columns=columns)\n",
    "index=0\n",
    "range_inc = range(35000, 105000, 5000)\n",
    "for i in range_inc:\n",
    "    df.loc[index]=[2016, 5, 50, i, False]\n",
    "    index+=1\n",
    "\n",
    "\n",
    "df=df.rename(index=df.inc_earning)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "index=0\n",
    "for i in df.inc_earning:\n",
    "    test = simtax.Household(year=df.loc[i,'year'], prov=df.loc[i,'prov'], age_1=df.loc[i,'age_1'], \n",
    "                            inc_earning_1=df.loc[i,'inc_earning'], ind_couple=df.loc[i,'ind_couple'])\n",
    "    test.inctaxes()\n",
    "    df_out.loc[index] = [test.prov_inctaxes_1, test.fed_inctaxes_1]\n",
    "    index+=1\n",
    "\n",
    "df_out.rename(index=df.inc_earning)\n",
    "df_out"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "dir(test)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
